package com.yesjava.springbootjpa.demo.dao;

import com.yesjava.springbootjpa.demo.entity.Category;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CategoryDao extends JpaRepository<Category,Integer> {
    @Query("select c from Category c where c.parent = null ")
    List<Category> myFindTop();
}
